using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vUserTypeInfoMap : EntityTypeConfiguration<vUserTypeInfo>
    {
        public vUserTypeInfoMap()
        {
            // Primary Key
            this.HasKey(t => t.kind);

            // Properties
            this.Property(t => t.kind)
                .IsRequired()
                .HasMaxLength(8);

            this.Property(t => t.UserType)
                .HasMaxLength(58);

            this.Property(t => t.FUNCNAME)
                .HasMaxLength(50);

            this.Property(t => t.AccessType)
                .HasMaxLength(16);

            // Table & Column Mappings
            this.ToTable("vUserTypeInfo");
            this.Property(t => t.project).HasColumnName("project");
            this.Property(t => t.kind).HasColumnName("kind");
            this.Property(t => t.UserType).HasColumnName("UserType");
            this.Property(t => t.FUNCNAME).HasColumnName("FUNCNAME");
            this.Property(t => t.AccessType).HasColumnName("AccessType");
        }
    }
}
